import request from "@/api/request";

const url = "/wiki/web"

export function wikis(query) {
    return request({
        url: `${url}/wiki/ebook`,
        method: 'get',
        params: query
    })
}

export function update(ebook) {
    return request.put(`${url}/wiki/ebook`,ebook)
}

export function save(ebook) {
    return request.post(`${url}/wiki/ebook`,ebook)
}

export function remove(ebookId){
    return request.delete(`${url}/wiki/ebook/${ebookId}`)
}


/**
 * 获取所有的分类
 * @param query
 * @returns {AxiosPromise}
 */
export function categories(query) {
    return request({
        url: `${url}/wiki/category/all`,
        method: 'get',
        params: query
    })
}
